from control.models import *
from literature.models import *
import pandas as pd
from django.db import IntegrityError, transaction
import json
from tqdm import tqdm
import traceback
from datetime import datetime
from basic_component_related_management.models import *


def modify_phase_error():
    Phase_entity_list = Phase.objects.filter()

    try:
        with transaction.atomic():
            for phase_entity in Phase_entity_list:
                if phase_entity.abbreviation == "V1":
                    continue

                name1 = phase_entity.name
                name2 = phase_entity.name_en

                phase_entity.name=name2
                phase_entity.name_en=name1
                phase_entity.save()
    except Exception as e:
        traceback.print_exc()
    

